<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<a href="#div1">查看内容1</a>
<div id="div1">内容1</div>

<a href="#div2">查看内容2</a>
<div id="div2">内容2</div>

<a href="#div3">查看内容3</a>
<div id="div3">内容3</div>

<a href="#div4">查看内容4</a>
<div id="div4">内容4</div>

<style type="text/css">
    a{
        display: block;
    }

    #div1, #div2, #div3, #div4 {
        display: none;
    }

    #div1:target, #div2:target, #div3:target, #div4:target {
        display: block;
    }
</style>


</body>
</html>